import request from "@/utils/request";

// --------------------------团购活动-----------------
//数据获取,查找
export function getList(date) {
  return request({
    url: "/admin/groupon/listRecord",
    method: "get",
    params: { date },
  });
}
//------------------------团购规则-------------------
//数据获取,查找
export function ruleList(data) {
  return request({
    url: "/admin/groupon/list",
    method: "get",
    params: data,
  });
}
//编辑
export function redact(data) {
  return request({
    url: "/admin/groupon/update",
    method: "post",
    data,
  });
}
//添加
export function add(data) {
  return request({
    url: "/admin/groupon/create",
    method: "post",
    data,
  });
}
//删除
export function del(data) {
  return request({
    url: "/admin/groupon/delete",
    method: "post",
    data,
  });
}

//-----------------------------专题管理---------------------------
// 获取数据，查找
export function artList(data) {
  return request({
    url: "/admin/topic/list",
    method: "get",
    params: data,
  });
}
//删除
export function artdel(data) {
  return request({
    url: "/admin/topic/delete",
    method: "post",
    data,
  });
}

export function dellll(data) {
  return request({
    url: "/admin/topic/batch-delete",
    method: "post",
    data,
  });
}
//---------------------------专题创建------------------------------
//数据获取，查找
export function findList(data) {
  return request({
    url: "/admin/goods/list",
    method: "get",
    params: data,
  });
}
// 添加
export function artadd(data) {
  return request({
    url: "/admin/topic/create",
    method: "post",
    data,
  });
}
//更新
export function artupdate(data) {
  return request({
    url: "/admin/topic/update",
    method: "post",
    data,
  });
}
// --------------------------优惠券管理-------------------------------------------
//数据获取，查找
export function cardList(data) {
  return request({
    url: "/admin/coupon/list",
    method: "get",
    params: data,
  });
}
export function cateList(data) {
  return request({
    url: "/admin/category/list",
    method: "get",
    params: data,
  });
}
export function goodList(data) {
  return request({
    url: "/admin/goods/list",
    method: "get",
    params: data,
  });
}

//--------------------------优惠券详情-------------------------------------------------
//数据获取，查找
export function idfind(data) {
  return request({
    url: "/admin/coupon/listuser",
    method: "get",
    params: data,
  });
}
export function addssss(data) {
  return request({
    url: "/admin/groupon/create",
    method: "post",
    data
  });
}
//删除
export function carddel(data) {
  return request({
    url: "/admin/coupon/delete",
    method: "post",
    data,
  });
}
//添加确定
export function cardadd(data) {
  return request({
    url: "/admin/coupon/create",
    method: "post",
    data,
  });
}
//--------------------------广告管理------------------------------------------
//数据获取，查找
export function adsList(data) {
  return request({
    url: "/admin/ad/list",
    method: "get",
    params: data,
  });
}
//删除
export function adsdel(data) {
  return request({
    url: "/admin/ad/delete",
    method: "post",
    data,
  });
}
//添加
export function adsadd(data) {
  return request({
    url: "/admin/ad/create",
    method: "post",
    data,
  });
}
//更新
export function adsredact(data) {
  return request({
    url: "/admin/ad/update",
    method: "post",
    data,
  });
}